import com.demo.controller.UserController;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.demo.entity.User;
public class App {
    public static void main(String[] args) {
       // System.out.println("hello world");
//        ApplicationContext context=new ClassPathXmlApplicationContext("spring-config.xml");
//        Student student=(Student) context.getBean("student");
//        student.students("张三",18,89);


        //1.得到spring容器
        ApplicationContext context=
                new ClassPathXmlApplicationContext("spring-config.xml");
//        User user= context.getBean("user1",User.class);
//        System.out.println(user.getUsername());

         UserController userController= context.getBean("userController", UserController.class);
         userController.sayHi();

    }
}
